<?php
/**
 * Created by PhpStorm.
 * User: Raytine
 * Date: 2018/8/29
 * Time: 14:45
 */
require_once dirname(__DIR__)."/base.php";

$orderData = new \PddWechat\Models\Pddorder\Data\PddOrderData();
$redis_key = "calculatemoney";

/**
 *获取审核通过的订单(3审核通过可提现的订单)
 */
$orderList = $orderData->selectByOrderStatus(3);
//如果订单不为空
if(!empty($orderList)) {
    //如果队列为空入队
    if(!\Dai\Framework\Library\RedisExt::getInstance()->lLen($redis_key)) {
        foreach ($orderList as $item) {
            echo $item->orderSn ." send to list\n";
            \Dai\Framework\Library\RedisExt::getInstance()->lPush($redis_key, $item->orderSn);
        }
    } else {
        echo "redis has value\n";
    }
}else {
    echo "orderList is empty\n";
}